<?php
	/**
	 * In: $catagorys
	 */
	if(!isset($def_catagory)) {
		$def_catagory = array("1"=>"计划","2"=>"回家探亲");
	}

	//文本框属性设定
	$content = array(
		"id"=>"content",
		"name"=>"content",
		"class"=>"content",
		"cols"=>40,
		"rows"=>8
	);
	//tag属性设定
	$tags = array(
		"id"=>"tags",
		"name"=>"tags"
	);

	$this->load->helper("form");
	echo form_fieldset("添加记录：",array("class"=>"addnote"));
	echo form_open("http://".$_SERVER['HTTP_HOST']."/index.php/note/add");
	echo form_label("分类：","catagory",array("class"=>"clearfix"));
	foreach($catagorys as $catagory) {
		$cata[$catagory['id']] = $catagory['catagory'];
	}
	$class = $cata + $def_catagory + array("添加新分类");
	echo form_dropdown("catagory",$class,array(),"id=\"catagory\"");
	echo form_label("内容：","content",array("class"=>"clearfix"));
	echo form_textarea($content);
	echo form_label("tags:","tags",array("class"=>"clearfix"));
	echo form_input($tags);
	echo form_submit(array("class"=>"mysub"),"我要提交");
	echo form_close();
	echo form_fieldset_close();
?>